#include <iostream>
#include <vector>
#include <cstring>
#include <algorithm>
using namespace std;

const int MOD = 1000000007;
const int ALPHABET_SIZE = 27; // 26 letters + '_'

int char2idx(char c) {
    if (c == '_') 
        return 26;
    return c - 'a';
}

int main() {
    int n, k;
    string s;
    cin >> n >> k;
    cin >> s;

    vector<bool> inS(ALPHABET_SIZE, false);
    for (char c : s) {
        int idx = char2idx(c);
        inS[idx] = true;
    }

    vector<long long> f(n + 1, 0);
    vector<long long> F(n + 1, 0);
    vector<vector<long long>> G(ALPHABET_SIZE, vector<long long>(n + 1, 0));
    vector<vector<long long>> dp(n + 1, vector<long long>(ALPHABET_SIZE, 0));

    vector<int> last_occurrence(ALPHABET_SIZE, -1);

    f[0] = 1;
    F[0] = 1;
    for (int c = 0; c < ALPHABET_SIZE; ++c) {
        dp[0][c] = 0;
        G[c][0] = 0;
    }

    for (int i = 1; i <= n; ++i) {
        int L = max(0, i - k);
        int R = i - 1;
        char current_char = s[i - 1];
        int current_idx = char2idx(current_char);

        for (int c = 0; c < ALPHABET_SIZE; ++c) {
            if (!inS[c]) {
                dp[i][c] = 0;
                continue;
            }

            int Rc = -1;
            if (c == current_idx) {
                Rc = i - 1;
            } else {
                Rc = last_occurrence[c];
            }

            if (Rc < L) {
                dp[i][c] = 0;
            } else {
                long long part1 = F[Rc] - (L - 1 >= 0 ? F[L - 1] : 0);
                long long part2 = G[c][Rc] - (L - 1 >= 0 ? G[c][L - 1] : 0);
                dp[i][c] = (part1 - part2) % MOD;
                if (dp[i][c] < 0) dp[i][c] += MOD;
            }
        }

        f[i] = 0;
        for (int c = 0; c < ALPHABET_SIZE; ++c) {
            if (inS[c]) {
                f[i] = (f[i] + dp[i][c]) % MOD;
            }
        }

        last_occurrence[current_idx] = i - 1;

        F[i] = (F[i - 1] + f[i]) % MOD;
        for (int c = 0; c < ALPHABET_SIZE; ++c) {
            if (inS[c]) {
                G[c][i] = (G[c][i - 1] + dp[i][c]) % MOD;
            } else {
                G[c][i] = G[c][i - 1];
            }
        }
    }

    cout << f[n] % MOD << endl;
    return 0;
}
